package day06;

import data.ClickSource;
import org.apache.flink.runtime.state.filesystem.FsStateBackend;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Description: 数据输出到文件
 * @Author: ZYX
 * @Date: 2022/2/16 13:27
 * @Version: 1.0
 */
public class Demo06 {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        env.setStateBackend( new FsStateBackend("file:///D:/gitDocument/learn/java-learning/flinkdemo/src/main/resources/ckpt",false));


        env.enableCheckpointing(10*1000L);

        env.addSource(new ClickSource())
                .print();

        env.execute();
    }

}
